using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
using Ruby;
using Ruby.Hosting;
using System;
using System.IO;
using System.Collections.Generic;
using System.Windows.Forms;


namespace IronLogo
{
    static class IronLogo
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
           
            LogoWindow logowin = new LogoWindow();
            
            IScriptEngine ruby = IronRuby.GetEngine(IronRuby.CreateRuntime());
            
            Dictionary<SymbolId, object> globalvars = IronRuby.GetExecutionContext(ruby.Runtime).GlobalVariables;
            globalvars[SymbolTable.StringToId("logowin")] = logowin;

            IScriptScope IronLogoScope = ruby.Runtime.CreateScope();
            
            ruby.Execute(IronLogoScope, ruby.CreateScriptSourceFromString(Properties.Resources.IronLogoRuby, SourceCodeKind.File));

            logowin.PassScopeAndEngine(IronLogoScope, ruby);
            
            logowin.ShowDialog();
            
        }
    }

}